Skip to content

fix(classification): a reply event's own copies take its owner's declaration; owner frame reaches every event slot (rf2-a1lj6, rf2-2co2d) - #11823

Merged
mike-thompson-day8 merged 1 commit into
mainfrom
worker/event-classification-fix
Oct 30, 2026
Merged

mike-thompson-day8 merged 1 commit into
mainfrom
worker/event-classification-fix

Conversation

@mike-thompson-day8

@mike-thompson-day8 mike-thompson-day8 commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Closes rf2-a1lj6 and rf2-2co2d. Both are one defect class at one chokepoint, re-frame.classification/redact-event-by-registration. An event-bearing copy was classified only by (first event)'s own registration, so an owner's declaration never reached it.

rf2-a1lj6: a reply event's own copies take its owner's declaration

A resource read reply or a mutation continuation reply arrives as the last argument of the app's :reply-to event (re-frame.reply/complete). That event's own run copies carried the owner-declared value raw: the live :rf.event/v, the bare :event error slot, the epoch :trigger-event under :rf.egress/include-event-args? true, and the always-on :rf.observe/error record at the default sink profile. Reproduced at trunk, where all four leaked {:token "PW"} while the FX carrier copy redacted.

  • redact-event-by-registration gets a third layer. Each argument carrying :rf.reply/work-kind is handed to a new resources-published hook, :resources/project-reply-event-arg.
  • The hook applies the reply arms the FX carrier already takes: the coarse owner claim (unregistered fails closed), otherwise the owner's declared paths, plus the :error envelope. It resolves the owner in the event's frame view (in-frame-view).
  • The arms now live in one fn, trace-egress/project-family-reply-slots. The carrier walk project-embedded-keys and the new hook both call it, so the event copy and the carrier copy agree by construction.
  • The hook leaves the scope rule and the scoped-key rule to the off-box projectors. It runs on every event-bearing slot, the on-box trace included, and the on-box family rows keep raw scopes (the reply-correlation suite pins this).
  • The app's own :reply-to handler still receives the raw reply.
  • The new hook has a row in late_bind/directory.cljc.

rf2-2co2d: the owner frame reaches every event slot

Every caller that holds the owner frame now passes it to the [event frame-id] arity. A spawned actor's event therefore takes its machine type's classification at each of these sites:

  • projection/redact-event-by-registration, under project-event-slot (the always-on :rf.observe/* records);
  • the router's refused-event trigger (classified-trigger) and its commit-halt trigger;
  • a mutation execute payload's :reply-to address. Core threads the frame through :resources/project-execute-event-args, which is now (fn [args frame-id]);
  • a managed request's reply addresses (re-frame.http.privacy/project-managed-fx-args). Core threads the frame through :http/project-managed-fx-args, which is now (fn [args frame-id]).

epoch/assembly.cljc does not read the hook. Its :trigger-event is the emit-projected :rf.event/v of the event's run-start, so it inherits the fix.

The bead's gate asks for "an action that throws". At trunk an action's own throw produces a structural :rf.error/machine-action-exception record with no :event (by design, re-frame.machines.error-emit). The test therefore makes the action return an effect that throws. The resulting :rf.error/fx-handler-exception record carries the routed event, and at trunk it leaked the password raw.

Tests

  • resources_reply_event_egress_cljs_test is new. It covers four owners (mutation and resource, path-declared and coarse) against targets that declare nothing. The FX carrier copy is the control, and every event copy must equal it. It also checks that an execute payload's :reply-to addressed to a spawned actor takes the actor's type classification.
  • spawned_actor_event_classification_test gets a new deftest for the always-on error record of a spawned instance's event. The singleton is the control.
  • http_reply_address_actor_classification_test is new. It sends a managed request's three reply addresses to a spawned actor through core's trace projection. The singleton is the control.

Planted faults, each run against its scoped namespace and then restored. Each restore was checked by blob hash against HEAD:

  • Reply arm removed from redact-event-by-registration: exit 1, 32 failures across all four owners (the always-on record, the live error trace, live :rf.event/v, the epoch trigger). The carrier-control assertions stayed green.
  • Frame dropped from projection's project-event-slot call: exit 1. The instance assertion fails with the raw password; the singleton control passes.
  • Frame dropped at the http reply address: exit 1, 2 failures. The singleton control passes.

Quality gates

  • JVM test counts on trunk, before this change: core 1470 tests / 4453 assertions, machines 707 / 1720, resources 594 / 1813. Predicted delta: core +0, machines +1 / +2, resources +3 / +58, http +1 / +3.
  • scripts/test-jvm-implementation.sh on the rebased tree: captured exit 0. Measured: core 1470 / 4453, machines 708 / 1722, resources 597 / 1871, http 230 / 791 (trunk CI for http: 229 / 788). Every delta matches the prediction. The http JVM lane is in that roster.
  • npm run test:cljs on the rebased tree: captured exit 0, 0 compile warnings, 6805 tests / 19931 assertions. Trunk CI at 83c1be4 shows 6802 / 19873, so +3 / +58, the new resources namespace as predicted. The late-bind publication pins run in this lane; the JVM late_bind_drift_test runs in core.
  • scripts/lint_kondo.py exit 0, with no findings in the touched files. Exit 0 also from check_require_alias_dialect.py, check_test_lane_bijection.py, check_egress_walker_residue.py, check_retired_spellings.py, check_ambient_durable_reads.py, check_thrown_error_messages.py, check_keyword_catalogue_drift.py and check-no-hardcoded-paths.sh.
  • No spec or doc page is touched. Spec 015's "One owner declaration, every echo" now holds for the reply event's own copies, so no sentence contradicts what ships.
  • This PR's CI is the final-base gate.

…aration; owner frame reaches every event slot (rf2-a1lj6, rf2-2co2d)

rf2-a1lj6: a resource or mutation continuation reply rides its :reply-to
target event as the last argument, so the event's own run copies (live
:rf.event/v, the bare :event error slot, the always-on :rf.observe/error
record, the epoch :trigger-event) echoed the owner-declared value raw.
redact-event-by-registration gains a per-argument layer: an argument
carrying :rf.reply/work-kind goes to the new resources-published
:resources/project-reply-event-arg hook, which applies the reply arms the
FX carrier already takes (coarse owner claim, else the owner's declared
paths, plus the :error envelope), resolving the owner in the event's frame
view. The arms are one fn in trace_egress, shared by the carrier walk and
the hook. The app's own :reply-to handler still receives the raw reply.

rf2-2co2d: the 1-arity callers that hold the owner frame now pass it to
the 2-arity, so a spawned actor's event takes its machine type's
classification there too: projection's project-event-slot (the
always-on records), the router's refused-event and commit-halt triggers,
a mutation execute payload's :reply-to address, and a managed request's
reply addresses. Core threads the frame through the
:resources/project-execute-event-args and :http/project-managed-fx-args
hooks.
@mike-thompson-day8
mike-thompson-day8 marked this pull request as ready for review October 30, 2026 00:19
@mike-thompson-day8
mike-thompson-day8 merged commit b037cf2 into main Oct 30, 2026
81 checks passed
@mike-thompson-day8
mike-thompson-day8 deleted the worker/event-classification-fix branch October 30, 2026 00:21
mike-thompson-day8 added a commit that referenced this pull request Oct 30, 2026
Merge: b037cf2 at 2026-10-30T00:21:21Z.
Completeness: Both source beads are addressed: all continuation reply copies use owner declarations and every frame-holding event projection passes its frame. Full patch, complete source beads, hook consumers and regressions inspected.
Correctness: The shared reply projector preserves raw app delivery and on-box scope semantics while covering coarse and path declarations. Instance versus singleton controls and reported fault plants exercise both fixes; hook producers and consumers agree on arity. No new actionable finding.
Implementation quality: One shared family-reply projection prevents carrier/event drift; frame threading uses existing resolution and hooks. Changes remain internal and preserve convenient public arities.
Findings: none.
Source forward pointers: none.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant